home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
304_01
/
roff5.lnk
< prev
next >
Wrap
Text File
|
1990-02-12
|
2KB
|
40 lines
/*documentation of linked list structures used in roff4*/
/*eeb jan 88*/
/*all of dynamic usage (the heap) is found in area known as: */
#define TRSIZ 2000
char TRTBL[TRSIZ];
typedef
struct {void *link;
char ident[1]; /*indefinitely long; terminated by \0 */
/*followed by integer, string, or pointer to structure*/
} entry ; /*can be searched by find2()*/
/*a series of intertwined linked lists are formed with last entries
pointed to by: */
entry *SLINK, /* string substitution table */ /*insert(), showit()*/
*MLINK, /* macro substitution table */ /*minsert(),showm(),macq()*/
/*SLINK,MLINK table entries are following ident string
with second string used as replacement*/
*RLINK, /* register substitution table;
ident string followed by int*/ /*showr(),regist()*/
*DLINK; /* diversion file table; ident string typically followed
by a pointer to divfd; divfd contains
pointer to name, character count, line count, and
pointer returned by fopen() or NULL
if the associated file is not open*/
/*dodiv(),dsclose(),dclose(),showd()*/
entry *TREND=(entry *)TRTBL; /*used to know current end of
TRTBL space usage*/
/* addition of new entries consists of:
entry *pe;
char *pc;
start(); {critical region}
pe = TREND;
pe->link = ?LINK;
pc = &pe.ident;
pc++ = stpcpy(pc, NAME);
Now pc points to where info should be placed;
Be sure to update TREND to point after last entry!
complete(); {end of critical region}
*/